﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views {
    import flash.events.*;
    import org.robotlegs.core.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.views.components.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class HospitalViewMediator extends Mediator implements IMediator {

		[Inject]
        public var hospitalView:HospitalView;
		[Inject]
        public var tickModel:TickModel;

        override public function onRegister():void{
            eventMap.mapListener(eventDispatcher, EventConstants.INIT_HOSPITAL_DISPLAY, this.initDisplay);
            eventMap.mapListener(eventDispatcher, EventConstants.RESET_HOSPITAL_DISPLAY, this.resetScrollDisplay);
            eventMap.mapListener(eventDispatcher, EventConstants.HIDE_HOSPITAL_DISPLAY, this.hideScrollDisplay);
            eventMap.mapListener(eventDispatcher, EventConstants.SHOW_HOSPITAL_DISPLAY, this.showScrollDisplay);
            eventMap.mapListener(eventDispatcher, EventConstants.SHOW_KINDERGARTEN_TEASER, this.showKindergartenTeaser);
            eventMap.mapListener(eventDispatcher, EventConstants.REMOVE_KINDERGARTEN_TEASER, this.removeKindergartenTeaser);
            this.setPositionAndScale();
        }
        private function setPositionAndScale():void{
            this.hospitalView.x = GameConstants.HOSPITAL_CENTER_POSITION.x;
            this.hospitalView.y = GameConstants.HOSPITAL_CENTER_POSITION.y;
            this.hospitalView.scaleX = (this.hospitalView.scaleY = GameConstants.HOSPITAL_SCALE);
        }
        private function showScrollDisplay(_arg1:Event):void{
            this.hospitalView.show();
        }
        private function hideScrollDisplay(_arg1:Event):void{
            this.hospitalView.hide();
        }
        private function resetScrollDisplay(_arg1:Event):void{
            this.hospitalView.reset();
        }
        private function initDisplay(_arg1:Event):void{
            this.hospitalView.init();
            this.setPositionAndScale();
        }
        private function showKindergartenTeaser(_arg1:Event):void{
            this.hospitalView.addKindergartenTeaser();
        }
        private function removeKindergartenTeaser(_arg1:Event):void{
            this.hospitalView.removeKindergartenTeaser();
        }

    }
}//package net.wooga.pets.views 
